<div class="container-fluid">
	<div class="widget-box">
		<div class="widget-title">
			<span class="icon">
				<i class="icon-th"></i>
			</span>
			<h5>账户操作</h5>
		</div>
		<div class="widget-content nopadding">
			<table   border="0"   class='table  table-striped' >
				<tr>
					<td width="75px">
						<button id="setPwdBtn" class="btn btn-mini" style="width:75px;height:27px;font-size:10pt">修改密码</button>
					</td>
					<td width="75px">
						<button id="blockBtn" class="btn btn-mini" style="width:105px;height:27px;font-size:10pt">冻结/解冻账号</button>
					</td>
					<td width="75px">
						<?php if($user_info['is_online']){?>
						<button id="delOnlineBtn" class="btn btn-mini" style="width:75px;height:27px;font-size:10pt">踢出在线</button>
						<?php }?>
					</td>
					<td>
						&nbsp;
					</td>
				<tr>
			</table>
		</div>
	</div>

	<div class="widget-box">
		<div class="widget-title">
			<span class="icon">
			<i class="icon-th"></i>
			</span>
			<h5>&nbsp;流水信息&nbsp;</h5>
		</div>

		<div class="widget-content nopadding">
			<table class='table table-bordered table-striped with-check'>
			<tr>
			<td style="width:85px;">			
				<a href="/user/userLog?sid=<?php echo $sid;?>&uid=<?php echo $user_info['uid'];?>" target='_blank'>人民币</a>
			</td>
			<td style="width:85px;">			
				<a href="/user/userLog?sid=<?php echo $sid;?>&uid=<?php echo $user_info['uid'];?>&table=log_ticket" target='_blank'>抵扣券</a>
			</td>
			<td width="70%">
				&nbsp;
			</td>
			</tr>
			</table>
		</div>
	</div>

	<div class="widget-box">
		<div class="widget-title">
			<span class="icon">
			<i class="icon-th"></i>
			</span>
			<h5>&nbsp;用户基本信息&nbsp;</h5>
		</div>
		<div class="widget-content nopadding">
			<table class='table table-bordered table-striped with-check' style="width: 100%;">
				<tr>
					<td style="text-align:left;width:12.5%; line-height: 40px;">
						&nbsp;UID：<?php echo $user_info['uid']?>&nbsp;（<?php echo $cny['diff_cny'] >=1?"<span style='color:#f00;'>异常</span>":"<span style='color:#333;'>正常</span>";?>）
					</td>
					<td style="text-align:left;width:12.5%;">
						&nbsp;平台：<?php echo $platform_list[$user_info['platform']]?>
					</td>
					<td   style="text-align:left;width:12.5%;">
						&nbsp;帐号：<?php echo $user_info['nickname']?>
					</td>
					<td   style="text-align:left;width:12.5%;">
						&nbsp;CNY账户余额：￥<?php echo $user_info['cny']?>
					</td>
					<td   style="text-align:left;width:12.5%;">
						&nbsp;体验券：<?php echo $user_info['ticket']?> 张
					</td>
					<td   style="text-align:left;width:12.5%;">
						&nbsp;绑定手机：+<?php echo $user_info['area']?>&nbsp;<?php echo $user_info['phone'];?>
					</td>
					<td   style="text-align:left;width:12.5%;">
						&nbsp;是否在线：<?php echo $user_info['is_online']?"<span style='color:#047C32;'>在线</span>":"<span style='color:#333;'>离线</span>";?>
					</td>
					<td   style="text-align:left;width:12.5%;">
						&nbsp;是否被冻结：<?php echo ($user_info['block']==1)?"<span style='color:#f00'>(冻结)</span>":"<span style='color:green;'>正常</span>"?>
					</td>
				</tr>			
				<tr>
					
					<td style="text-align:left;line-height: 40px;">&nbsp;创建IP：<?php echo $user_info['create_ip']?></td>
					<td style="text-align:left">&nbsp;创建时间：<?php echo $user_info['create_time']?></td>
					<td style="text-align:left;width:12.5%;" >&nbsp;来源：<?php echo ($user_info['comefrom'] == 1)?'网页':'移动客户端';?></td>
					<td style="text-align:left">&nbsp;最后登录城市：<?php echo $user_info['last_city']?></td>
					<td style="text-align:left" colspan="2">&nbsp;最后登录时间：<?php echo $user_info['last_time']?></td>
					<td style="text-align:left;" colspan="2">&nbsp;Openid：<?php echo $user_info['openid']?></td>
				</tr>							
				<tr>
					<td  colspan="8"   style="text-align:left;vertical-align:middle;line-height: 40px;">
					&nbsp;本周盈利（<?php echo $week_start_date;?>到<?php echo date("Y-m-d",strtotime($week_end_date));?>）CNY：&nbsp;&nbsp;￥<?php echo $cny['week_yk'];?>
					</td>
					</tr>			
				</table>
		</div>
	</div>

	<div class="widget-box">
		<div class="widget-title">
			<span class="icon">
			<i class="icon-th"></i>
			</span>
			<h5>&nbsp;个人账目统计&nbsp;</h5>
		</div>
		<div class="widget-content nopadding">
		<table class='table table-bordered table-striped'>
			<thead>
				<tr  class="strong" >
				<th width='100'>类型</th>
				<th >充值</th>
				<th >提现</th>
				<th >已实现盈利</th>
				<th >持仓盈亏</th>
				<th >总盈利</th>
				<th >CFD持仓保证金</th>
				<th >CFD交易手续费</th>
				<th >CFD交易提成</th>
				<th >购买抵扣券</th>
				<th >应得账户余额</th>
				<th ></th>
				</tr>			
			</thead>
			<tbody>
				<tr>
				<th>CNY(人民币币)</th>
				<td>￥<?php echo $cny['deposit']?> </td>
				<td>￥<?php echo $cny['withdraw']?> </td>
				<td>￥<?php echo $cny['history_yk'] ?> </td>
				<td>￥<?php echo $cny['chi_yk'] ?> </td>
				<td>￥<?php echo $cny['total_yk'] ?> </td>
				<td>￥<?php echo $cny['cfd_chi_bzj'] ?> </td>
				<td>￥<?php echo $cny['cfd_fee'] ?> </td>
				<td>￥<?php echo $cny['cfd_invite'] ?> </td>
				<td>￥<?php echo $cny['ticketCny'] ?> </td>
				<td>￥<?php echo $cny['deserved'] ?> </td>
				<td width="30%"></td>
				</tr>
				<tr>
			</tbody>
		</table>
		</div>
	</div>

	<div class="widget-box">
		<div class="widget-title">
			<span class="icon">
			<i class="icon-th"></i>
			</span>
			<h5>&nbsp;差价合约信息&nbsp;</h5>
		</div>
		<div class="widget-content nopadding">
		<table class='table table-bordered table-striped'>
			<thead>
					<tr  class="strong" >
						<th width='100'>类型</th>
						<th >持仓市值</th>
						<th >人民币持仓</th>
						<th >抵扣券持仓</th>
						<th >做多持仓</th>
						<th >做空持仓</th>
						<th >持仓盈亏</th>
						<th >总盈亏</th>
					  </tr>
					   
					   <?php if(isset($productList))foreach($productList as $items){?>
					  <tr>
						<td><?php echo $items['desc']; ?></td>
						<td>￥<?php echo isset($chi_data[$items['name']]['value'])?array_sum($chi_data[$items['name']]['value']):0;?> </td>
						<td>￥<?php echo isset($chi_data[$items['name']]['dtype']['cny'])?$chi_data[$items['name']]['dtype']['cny']:0; ?> </td>
						<td>￥<?php echo isset($chi_data[$items['name']]['dtype']['ticket'])?$chi_data[$items['name']]['dtype']['ticket']:0; ?> </td>
						<td>￥<?php echo isset($chi_data[$items['name']]['value']['bid'])?$chi_data[$items['name']]['value']['bid']:0; ?> </td>
						<td>￥<?php echo isset($chi_data[$items['name']]['value']['ask'])?$chi_data[$items['name']]['value']['ask']:0; ?> </td>
						<td>￥<?php echo isset($chi_data[$items['name']]['yk'])?$chi_data[$items['name']]['yk']:0;?> </td>
						<td>￥<?php echo isset($cfd_yk_arr[$items['name']])?$cfd_yk_arr[$items['name']]:0;?> </td>
					  </tr>
					<?php }?>
				   </thead>
		</table>
		</div>
	</div>
</div>

<!--  修改用户密码  -->
<form name='setPwdForm' id="setPwdForm" style='display:none;'  >
<input type='hidden' name='uid' value='<?php echo $user_info['uid'];?>'>
<table width='340px'  border='0' cellpadding='0' cellspacing='0' align="center" style="margin-top:10px">
  <tr>
    <td align='left'>
		<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" >
			<tr height="30" bgcolor="#FFFFFF" align="center" onmouseout="javascript:this.bgColor='#FFFFFF';" onmousemove="javascript:this.bgColor='#FCFDEE';">
				<td align='left'>
					<table border='0' cellpadding='0' cellspacing='0' >
					<tr>
						<td width='100' align='right'>UID：</td>
						<td><?php echo $user_info['uid'];?></td>	
					</tr>
					</table>
				</td>
			</tr>
			<tr height="30" bgcolor="#FFFFFF" align="center" onmouseout="javascript:this.bgColor='#FFFFFF';" onmousemove="javascript:this.bgColor='#FCFDEE';">
				<td align='left'>
					<table border='0' cellpadding='0' cellspacing='0'>
					<tr>
						<td width='100' align='right'>
						新密码：
						</td>
						<td>
							<input type='password' name='new_passwd' value=''  autocomplete="off" style='width:150px' />
						</td>
					</tr>
					</table>
				</td>
			</tr>
			<tr height="30" bgcolor="#FFFFFF" align="center" onmouseout="javascript:this.bgColor='#FFFFFF';" onmousemove="javascript:this.bgColor='#FCFDEE';">
				<td align='left'>
					<table border='0' cellpadding='0' cellspacing='0'>
					<tr>
						<td width='100' align='right'>
						确认新密码：
						</td>
						<td>
							<input type='password' name='new_passwd2' value='' autocomplete="off" style='width:150px' />
						</td>
					</tr>
					</table>
				</td>
			</tr>
		</table>
    </td>
  </tr>
</table>
</form>

<form name='form7' id="blockForm" style='display:none;' action='index.php' method='get'>
<input type='hidden' name='uid' value='<?php echo $user_info['uid'];?>'>
<table width='340px'  border='0' cellpadding='0' cellspacing='0' align="center" style="margin-top:10px">
  <tr>
    <td align='left'>
		<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" >
			<tr height="30" bgcolor="#FFFFFF" align="center" onmouseout="javascript:this.bgColor='#FFFFFF';" onmousemove="javascript:this.bgColor='#FCFDEE';">
				<td align='left'>
					<table border='0' cellpadding='0' cellspacing='0' >
					<tr>
						<td width='90' align='right'>UID：</td>
						<td><?php echo $user_info['uid'];
				         if($user_info['block']==0){
				         	echo "<font color=green>&nbsp;正常</font>";
				         }else if($user_info['block']==1){
							 if($lock_arr['status']==1){
								echo "<font color=red>&nbsp;冻结：该用户已被".$lock_arr['admin_name']."限制解冻</font>";
							 }else{
				         		echo "<font color=red>&nbsp;冻结</font>";
							 }
				         }
						?></td>	
					</tr>
					</table>
				</td>
			</tr>
			<tr height="30" bgcolor="#FFFFFF" align="center" onmouseout="javascript:this.bgColor='#FFFFFF';" onmousemove="javascript:this.bgColor='#FCFDEE';">
				<td align='left'>
					<table border='0' cellpadding='0' cellspacing='0'>
					<tr>
						<td width='90' align='right'>
						冻结/解冻：
						</td>
						<td>
							<input type='radio' name='block' value='1' <?php if($user_info['block'] == 0){echo 'checked="checked"';}?> />冻结
							<input type='radio' name='block' value='0' <?php if($user_info['block'] == 1){echo 'checked="checked"';}?> />解冻
							&nbsp;
							&nbsp;
							<span id="show_block_type">限制解冻<input type='checkbox' name='self_unlock' value='1'   title="当锁定后，只允许我解锁"/></span>
						</td>
					</tr>
					<tr>
					<td width='90' align='right'>备注说明:</td>
					<td><textarea   name='blockmemo'><?php echo isset($lock_arr['action_memo'])?$lock_arr['action_memo']:"";?></textarea></td>
					</tr>
					</table>
				</td>
			</tr>
		</table>
    </td>
  </tr>
</table>
</form>

<form name='form8' id="delOnlineForm" style='display:none;' action='index.php' method='post'>
<input type='hidden' name='uid' value='<?php echo $user_info['uid'];?>'>
<table width='340px'  border='0' cellpadding='0' cellspacing='0' align="center" style="margin-top:10px">
  <tr>
    <td align='left'>
		<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" >
			<tr height="30" bgcolor="#FFFFFF" align="center" onmouseout="javascript:this.bgColor='#FFFFFF';" onmousemove="javascript:this.bgColor='#FCFDEE';">
				<td align='left'>
					<table border='0' cellpadding='0' cellspacing='0' >
					<tr>
						<td width='120' align='right'>UID：</td>
						<td><?php echo $user_info['uid'];?></td>	
					</tr>
					</table>
				</td>
			</tr>
		</table>
    </td>
  </tr>
</table>
</form>

<script language="javascript">
$(function(){
	$("#setPwdBtn").click(function(){
		artDialog(
				{	
					'title':'修改密码',
					width:'360',
					height:'270' ,
					okVal:"确认修改",
					cancelVal:'取消',
					drag:true,
					content:"<form id='setPwdForm_' method='POST' action='/user/setPwd?sid=<?php echo $sid?>'  >"+$('#setPwdForm').html()+"</form>",
					lock:true,
				},
				function(){
						$('#setPwdForm_').submit();
				},
				function(){
					return true;
				}
		 );
		});

	$("#blockBtn").click(function(){
		artDialog(
		        {	
			        'title':'冻结账户',
			        width:'360',
			        height:'270' ,
			        okVal:"确定",
			        cancelVal:'取消',
			        drag:true,
		            content:"<form id='blockForm_' method='POST' action='/user/block?sid=<?php echo $sid?>'  >"+$('#blockForm').html()+"</form>",
		            lock:true,
		        },
		        function(){
		                $('#blockForm_').submit();
		        },
		        function(){
		            return true;
		        }
		 );
	});
	
	$("#delOnlineBtn").click(function(){
		artDialog(
		        {	
			        'title':'提出在线',
			        width:'360',
			        height:'270' ,
			        okVal:"确定",
			        cancelVal:'取消',
			        drag:true,
		            content:"<form id='delOnlineForm_' method='POST' action='/user/delOnline?sid=<?php echo $sid?>'  >"+$('#delOnlineForm').html()+"</form>",
		            lock:true,
		        },
		        function(){
		                $('#delOnlineForm_').submit();
		        },
		        function(){
		            return true;
		        }
		 );
	});

	$("#unlockAccountBtn").click(function(){
			artDialog(
			        {	
				        'title':'解锁帐号',
				        width:'360',
				        height:'270' ,
				        okVal:"解锁账号",
				        cancelVal:'取消',
				        drag:true,
			            content:"<form id='unlockAccountForm_' method='POST' action='index.php?c=user&a=unlockAccount&sid=<?php echo $sid?>'  >"+$('#unlockAccountForm').html()+"</form>",
			            lock:true,
			        },
			        function(){
			                $('#unlockAccountForm_').submit();
			        },
			        function(){
			            return true;
			        }
			 );
		});
});
</script>